/**
 run on google apps script
 @author jjverderber
 @license eclipse epl 1.0
**/
var _ = _ || undefined;
function defineUnderscore(version) 
{
  if(!version){version='1.5.1';}
  if( _ === undefined )
  {
    var url = "http://cdnjs.cloudflare.com/ajax/libs/underscore.js/"+version+"/underscore-min.js";
    Logger.log("Fetching underscore from '"+url+"'...");
    var underscoreJS = UrlFetchApp.fetch(url).getContentText();
    Logger.log("Underscore fetched, defining...");
    eval(underscoreJS);
    Logger.log("Underscore is defined as '_'.");
  }
  else{
    Logger.log("Underscore is already defined as '_'.");
  }
}
function redefineUnderscore(version)
{
  _ = undefined;
  defineUnderscore(version);
}
